package com.immunology.servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.immunology.model.MappingPages;

public class AdminServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public AdminServlet() {
		super();
	}

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		getServletContext().getRequestDispatcher(MappingPages.ADMIN_JSP)
				.forward(request, response);
		/*
		 * User userFromSession = (User) request.getSession().getAttribute(
		 * AttributeContent.USER); if (userFromSession != null &&
		 * userFromSession.getRole() == Role.ADMIN) { GetUserInterestsService
		 * interestsService = new GetUserInterestsService(); List<Interest>
		 * interests = interestsService .getInterestUser(userFromSession);
		 * List<Comment> comments = new CommentService()
		 * .getCommentsByUserId(userFromSession.getId()); List<User> friends =
		 * new FriendService() .getFriendsByUserId(userFromSession.getId());
		 * request.setAttribute("myInterests", interests);
		 * request.setAttribute("friends", friends);
		 * request.setAttribute(AttributeContent.USER, userFromSession);
		 * request.setAttribute("interests", interests);
		 * request.setAttribute("userFromSession", userFromSession);
		 * request.setAttribute("comments", comments); boolean isFriend = new
		 * UserService().isFriend( userFromSession.getId(),
		 * userFromSession.getId()); request.setAttribute("isFriend", isFriend);
		 * getServletContext().getRequestDispatcher(MappingPages.ADMIN_JSP)
		 * .forward(request, response); } else { response.sendRedirect(""); }
		 */
	}
}
